#产生10个不同的随机数，将其保存到列表中,再求出此列表中的最大最小值
#系统中有求最大值、最小值、求和的函数:max() min() sum()
# import random
# list1 = []
# for i in range(10):
#     n = random.randint(1,15)
#     if n not in list1:
#         list1.append(n)
# print(list1)  #个数不一定是10个，所以此方法有缺陷

import random
list2 = []
i = 0
while i < 10:
    m = random.randint(1,15)
    if m not in list2:
        list2.append(m)
        i += 1
print(list2)
max1 = list2[0]
min1 = list2[0]
for i in list2:
    if i > max1:
        max1 = i
    if i < min1:
        min1 = i
print(max1,min1)
